package tcakes.ccrefactoring;

import java.text.ParseException;

public class Main {

    public static void main(String[] args) {
        try {
            Args arg = new Args("l,p#,d[*]", new String[] { "-d", "p", "q", "-p", "210", "-l"});
            boolean logging = arg.getBoolean('l');
            int port = arg.getInt('p');
            String[] directory = arg.getStringArray('d');
            System.out.print("StringArray:[");
            for (String element : directory){
                System.out.print(" " + element);
            }
            System.out.println("]");
            System.out.println("Port: " + port);
            System.out.println("Logging: " + logging);
        }catch (ArgsException e ) {
            System.out.printf("Argument error: %s\n", e.getMessage());
        }
//        } catch (ArgsException e) {
//            System.out.printf("Argument error: %s\n", e.errorMessage());
//        }
    }
}
